﻿<UserControl
    x:Class="ParentingTrackerApp.Views.ExportView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ParentingTrackerApp.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400"
    SizeChanged="UserControlOnSizeChanged">
    <Grid Name="MainGrid">
        <Grid.RowDefinitions>
            <RowDefinition x:Name="UpperRow"/>
            <RowDefinition x:Name="LowerRow"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Name="UpperStack">
            <Grid Name="InputGrid">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition x:Name="HeaderButtonCol" Width="70"/>
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition/>
                    <ColumnDefinition x:Name="SelectButtonCol" Width="30"/>
                    <ColumnDefinition x:Name="OneDriveButtonCol" Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Name="Header" VerticalAlignment="Center">File path:</TextBlock>
                <Border Grid.Column="1" Background="Yellow" Height="25" Width="20">
                    <TextBlock Foreground="Red" VerticalAlignment="Center" Text="&#xE2C0;" FontFamily="Segoe UI Symbol" >
                        <ToolTipService.ToolTip>
                            <TextBlock TextWrapping="Wrap" Name="InfoText">The following external file will be updated with entries in this app without losing any existing data. It can be shared accross devices if it's on OnDrive, access to which may require authentication.</TextBlock>
                        </ToolTipService.ToolTip>
                    </TextBlock>
                </Border>
                <TextBox Grid.Column="2" Text="{Binding ExportFileText, Mode=TwoWay}" PlaceholderText="{Binding ExportFilePlaceHolderText}">
                </TextBox>
                <Button Name="Select" Grid.Column="3" Click="SelectFileOnClick">...</Button>
                <CheckBox Name="OneDrive" Grid.Column="4" Content="Mobile" IsChecked="{Binding ExportUsingOneDriveSdk, Mode=TwoWay}">
                    <ToolTipService.ToolTip>
                        <TextBlock TextWrapping="Wrap">Tick this box if you wanted to use the same OneDrive based file sharing mechanism as with your mobile phones. The file with the specified name will be in the Document folder of your OneDrive.</TextBlock>
                    </ToolTipService.ToolTip>
                </CheckBox>
            </Grid>
            <StackPanel Orientation="Horizontal">
                <StackPanel.Resources>
                    <Style TargetType="Button">
                        <Setter Property="Width" Value="80"></Setter>
                    </Style>
                </StackPanel.Resources>
                <Button Click="ExportOnClick" Name="MergeButton" Content="Merge">
                    <ToolTipService.ToolTip>
                        <TextBlock>Merge the events on the device to the specified file</TextBlock>
                    </ToolTipService.ToolTip>
                </Button>
                <Button Click="ViewOnClick" Name="ViewButton" Content="View">
                    <ToolTipService.ToolTip>
                        <TextBlock>Refresh the display of the content of the external file</TextBlock>
                    </ToolTipService.ToolTip>
                </Button>
                <Button Click="ClearOnClick" Content="Clear"
                        PointerEntered="RedHighlightButtonOnPointerEntered"
                        PointerExited="RedHighlightButtonOnPointerExited"
                        PointerCanceled="RedHighlightButtonOnPointerExited"
                        PointerCaptureLost="RedHighlightButtonOnPointerExited"
                        PointerReleased="RedHighlightButtonOnPointerExited">
                    <ToolTipService.ToolTip>
                        <TextBlock>Empty the external file</TextBlock>
                    </ToolTipService.ToolTip>
                </Button>
            </StackPanel>
        </StackPanel>
        <WebView Grid.Row="1"
                 HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                 Name="Nav"></WebView>
    </Grid>
</UserControl>
